<?php
    include 'base.php';
    $username = $_POST['username'];
    $password = $_POST['password'];
    #表的字段
    $sql = "SELECT * FROM `user` WHERE `username`='$username' AND `password`='$password'";
    $res = $conn->query($sql);
    $row = mysqli_fetch_assoc($res);
    if ($row) {
        echo json_encode(Array("err" => 0, "msg" => "登陆成功", "code" => 200));
    } else {
        echo json_encode(Array("err" => 1, "msg" => "账户名或者密码错误", "code" => 200));
    }
?>